package com.xhcl.web.controller.system;

import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.xhcl.common.annotation.Log;
import com.xhcl.common.enums.BusinessType;
import com.xhcl.system.domain.TSrhsDwye;
import com.xhcl.system.service.ITSrhsDwyeService;
import com.xhcl.common.core.controller.BaseController;
import com.xhcl.common.core.domain.AjaxResult;
import com.xhcl.framework.uitls.poi.ExcelUtil;
import com.xhcl.common.core.page.TableDataInfo;

/**
 * 单位年初余额查询Controller
 * 
 * @author xhcl
 * @date 2020-08-30
 */
@Controller
@RequestMapping("/system/dwye")
public class TSrhsDwyeController extends BaseController
{
    private String prefix = "system/dwye";

    @Autowired
    private ITSrhsDwyeService tSrhsDwyeService;

    @RequiresPermissions("system:dwye:view")
    @GetMapping()
    public String dwye()
    {
        return prefix + "/dwye";
    }

    /**
     * 查询单位年初余额查询列表
     */
    @RequiresPermissions("system:dwye:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(TSrhsDwye tSrhsDwye)
    {
        startPage();
        List<TSrhsDwye> list = tSrhsDwyeService.selectTSrhsDwyeList(tSrhsDwye);
        return getDataTable(list);
    }

    /**
     * 导出单位年初余额查询列表
     */
    @RequiresPermissions("system:dwye:export")
    @Log(title = "单位年初余额查询", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    @ResponseBody
    public AjaxResult export(TSrhsDwye tSrhsDwye)
    {
        List<TSrhsDwye> list = tSrhsDwyeService.selectTSrhsDwyeList(tSrhsDwye);
        ExcelUtil<TSrhsDwye> util = new ExcelUtil<TSrhsDwye>(TSrhsDwye.class);
        return util.exportExcel(list, "dwye");
    }
    
}
